Skip to main content

Get Audit subscription status

This endpoint allows the end user to fetch the current status of the audit subscription. If the subscription is running, it should return 'active' status. Otherwise, it will return 'pause'

URL : http://34.122.70.8/api/v1/audit/subscription/status

Method : GET

Auth required : YES

HeadersTypeDescription
api-keystringUnique api key provided to each Customer

Permissions required : None

Data constraints

Provide info including where the service should forward the Audit Records, the maximum number of records in each payload, and the frequency for sending them.

Response Body:

FieldTypeDescription
statusBooleanStatus of the request
msgstringResponse message from server
dataData Object
error_codestringError code received from server in case of error in fetching status of subscription
error_msgstringError message received from server in case of error in fetching status of subscription

Data Object:

FieldTypeDescription
statusobjectAccount level default_preferences object

Data example

Success Response

Condition : Subscription in pause status.

Code : 200 OK

Content example

{
"status": true,
"msg": "Audit subscription status fetched successfully",
"data": {
"status": "pause"
}
}

Or

Condition : Subscription in pause status.

Code : 200 OK

Content example

{
"status": true,
"msg": "Audit subscription status fetched successfully",
"data": {
"status": "active"
}
}

Error Responses

Condition : If subscription does not exist.

Code : 404 Not Found

Content :

{
"status": false,
"error_code": "NOT_FOUND",
"error_msg": "Subscription record not found"
}

Or

Condition : If api-key is not passed in request header or is wrong.

Code : 401 Unauthorized

Content example

{
"status": false,
"error_code": "AUDIT_UNAUTHORIZED",
"error_msg": "Missing/MisMatch API KEY"
}
const fetch = require('node-fetch');

let url = 'http://34.122.70.8/api/v1/audit/subscription/status';

let options = {method: 'GET', headers: {'api-key': '<API_KEY>'}};

fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error('error:' + err));